CREATE TABLE [dbo].[TMPARA_CONT]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[NU_ANNO] [dbo].[TD_IN_004_ANNO] NOT NULL CONSTRAINT [DF__TMPARA_CO__NU_AN__3B40CD36] DEFAULT (datepart(year,getdate())),
[NU_INFO_CORP] [dbo].[TD_IN_001_CONT] NULL,
[NV_INFO_CNTA] [dbo].[TD_IN_001] NOT NULL,
[NV_QUIE_CNTA] [dbo].[TD_VC_040] NOT NULL,
[NU_ACTU_ANNO] [dbo].[TD_IN_004_ANNO] NULL CONSTRAINT [DF__TMPARA_CO__NU_AC__3F115E1A] DEFAULT (datepart(year,getdate())),
[NU_ACTU_MESE] [dbo].[TD_IN_002_MESE] NULL,
[ST_ASIE_ANUA] [dbo].[TD_VC_001_SINO] NOT NULL CONSTRAINT [DF__TMPARA_CO__ST_AS__41EDCAC5] DEFAULT ('N'),
[ST_ASIE_APRO] [dbo].[TD_VC_001_SINO] NOT NULL CONSTRAINT [DF__TMPARA_CO__ST_AS__43D61337] DEFAULT ('N'),
[ST_MOVI_APRO] [dbo].[TD_VC_003] NOT NULL,
[ST_ASIE_GEST] [dbo].[TD_VC_003] NULL,
[ST_GEST_LINE] [dbo].[TD_VC_001_SINO] NOT NULL CONSTRAINT [DF__TMPARA_CO__ST_GE__47A6A41B] DEFAULT ('N'),
[IM_MAXI_NRET] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TMPARA_CO__IM_MA__498EEC8D] DEFAULT ((0)),
[NU_MAXI_FILA] [dbo].[TD_IN_001] NULL,
[TI_AUXI_REGA] [dbo].[TD_VC_001] NULL,
[CO_AUXI_REGA] [dbo].[TD_VC_020] NULL,
[TI_AUXI_REPE] [dbo].[TD_VC_001] NULL,
[CO_AUXI_REPE] [dbo].[TD_VC_020] NULL,
[CO_SUNA_NOCR] [dbo].[TD_VC_002] NULL,
[TI_AUXI_DCGA] [dbo].[TD_VC_001] NULL,
[CO_AUXI_DCGA] [dbo].[TD_VC_020] NULL,
[TI_AUXI_DCPE] [dbo].[TD_VC_001] NULL,
[CO_AUXI_DCPE] [dbo].[TD_VC_020] NULL,
[ST_TIPO_ACTU] [dbo].[TD_VC_003] NULL,
[ST_TIPO_CAMB] [dbo].[TD_VC_003] NULL,
[ST_REEM_ASIE] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMPARA_CO__ST_RE__4D5F7D71] DEFAULT ('N'),
[ST_DFCA_LINE] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMPARA_CO__ST_DF__4F47C5E3] DEFAULT ('N'),
[ST_ASIE_DFCA] [dbo].[TD_VC_003] NOT NULL,
[NU_DIIA_INIC] [dbo].[TD_IN_002] NULL,
[NU_MESE_INIC] [dbo].[TD_IN_002_MESE] NULL,
[NU_DIIA_FINA] [dbo].[TD_IN_002] NULL,
[NU_MESE_FINA] [dbo].[TD_IN_002_MESE] NULL,
[ST_RECU] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMPARA_CO__ST_RE__55F4C372] DEFAULT ('S'),
[CO_SUNA_LIQU] [dbo].[TD_VC_002] NULL,
[CO_SUNA_POLI] [dbo].[TD_VC_002] NULL,
[CO_SUNA_SERV] [dbo].[TD_VC_002] NULL,
[CO_MONE_DOLA] [dbo].[TD_VC_003] NULL,
[NU_CORR_CASI] [dbo].[TD_IN_001] NULL,
[CO_ORDE_DCGA] [dbo].[TD_VC_020] NULL,
[CO_ORDE_DCPE] [dbo].[TD_VC_020] NULL,
[CO_ORDE_REGA] [dbo].[TD_VC_020] NULL,
[CO_ORDE_REPE] [dbo].[TD_VC_020] NULL,
[ST_RETE_IGV1] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMPARA_CO__ST_RE__57DD0BE4] DEFAULT ('N'),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL,
[CO_PLAN_CONT] [dbo].[TD_VC_002] NOT NULL,
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMPARA_CO__FE_US__59C55456] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMPARA_CO__FE_US__5AB9788F] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__IM_MA__4A8310C6] CHECK (([IM_MAXI_NRET]>=(0)))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__NU_AC__40058253] CHECK (([NU_ACTU_ANNO]>=(0)))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__NU_AC__40F9A68C] CHECK (([NU_ACTU_MESE]>=(0) AND [NU_ACTU_MESE]<=(13)))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__NU_AN__3C34F16F] CHECK (([NU_ANNO]>=(0)))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__NU_DI__5224328E] CHECK (([NU_DIIA_INIC]>=(0)))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__NU_DI__540C7B00] CHECK (([NU_DIIA_FINA]>=(0)))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__NU_IN__3D2915A8] CHECK (([NU_INFO_CORP]>=(1) AND [NU_INFO_CORP]<=(99)))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__NU_ME__531856C7] CHECK (([NU_MESE_INIC]>=(0) AND [NU_MESE_INIC]<=(13)))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__NU_ME__55009F39] CHECK (([NU_MESE_FINA]>=(0) AND [NU_MESE_FINA]<=(13)))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__NV_IN__3E1D39E1] CHECK (([NV_INFO_CNTA]>=(1) AND [NV_INFO_CNTA]<=(99)))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__ST_AS__42E1EEFE] CHECK (([ST_ASIE_ANUA]='N' OR [ST_ASIE_ANUA]='S'))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__ST_AS__44CA3770] CHECK (([ST_ASIE_APRO]='N' OR [ST_ASIE_APRO]='S'))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__ST_AS__46B27FE2] CHECK (([ST_ASIE_GEST]='COP' OR [ST_ASIE_GEST]='ORI'))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__ST_AS__51300E55] CHECK (([ST_ASIE_DFCA]='COP' OR [ST_ASIE_DFCA]='ORI'))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__ST_DF__503BEA1C] CHECK (([ST_DFCA_LINE]='N' OR [ST_DFCA_LINE]='S'))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__ST_GE__489AC854] CHECK (([ST_GEST_LINE]='N' OR [ST_GEST_LINE]='S'))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__ST_MO__45BE5BA9] CHECK (([ST_MOVI_APRO]='APR'))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__ST_RE__4E53A1AA] CHECK (([ST_REEM_ASIE]='N' OR [ST_REEM_ASIE]='S'))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__ST_RE__56E8E7AB] CHECK (([ST_RECU]='N' OR [ST_RECU]='S'))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__ST_RE__58D1301D] CHECK (([ST_RETE_IGV1]='N' OR [ST_RETE_IGV1]='S'))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__ST_TI__4B7734FF] CHECK (([ST_TIPO_ACTU]='MEN' OR [ST_TIPO_ACTU]='ANU'))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [CK__TMPARA_CO__ST_TI__4C6B5938] CHECK (([ST_TIPO_CAMB]='TRA' OR [ST_TIPO_CAMB]='CIE' OR [ST_TIPO_CAMB]='PRO'))
GO
ALTER TABLE [dbo].[TMPARA_CONT] ADD CONSTRAINT [TMPARA_CONT_01] PRIMARY KEY CLUSTERED  ([CO_EMPR]) ON [PRIMARY]
GO
